#!/bin/bash
#========================================================================
# Author: YSLin
# Email: 
# File Name: send.sh
# Description: 
#   stty -a show all key bindings to send these signals
#   trap -l
# Edit History: 
#   2011-01-19    File created.
#========================================================================
#Here signal is either the number or name of the signal to deliver and pid is the process ID that the signal
#should be sent to.
kill -signal pid

#These are equivalent.
kill pid
kill -s SIGTERM pid

#the default action for this signal calls for the process to terminate, many UNIX programs use the HUP signal
#as an indication that they should reinitialize themselves.
kill -s SIGHUP 1001
#sends the HUP or hang-up signal to the program that is running with process ID 1001. You can also use the
#numeric value of the signal as follows:
kill -1 1001

#If the default kill command cannot terminate a process, you can try to send the process either a QUIT or
#an INT (interrupt) signal as follows:
kill -s SIGQUIT 1001
#or
kill -s SIGINT 1001

#Some programs and shell scripts have special functions called signal handlers that can ignore or
#discard these signals

kill -9 1001
#The kill signal has the special property that it cannot be caught, thus any process receiving this signal
#terminates immediately "with extreme prejudice." This means that a process cannot cleanly exit and might
#leave data it was using in a corrupted state. You should only use this signal to terminate a process when all
#the other signals fail to do so.



